<layout name='Layout/layout_page' />
<script type="text/javascript">
function jumpUrl(){
  v = document.getElementById("eventID").options[document.getElementById("eventID").selectedIndex].value;
  url="<{:U('Events/sign')}>&eventID=" + v;
  window.location.href=url;
}
</script>
    <ol class="breadcrumb">
        <li><a href="<{:U('Events/index')}>"><{:L('_menu_events')}></a></li>
        <li class="active">Sign up</li>
    </ol>

    <div class="form-inline" >
      <div class="form-group">
        <select name="eventID" id="eventID" class="form-control input-sm" onchange="jumpUrl()">
        <option value="">All</option>
        <volist name="event" id="vo">
        <option value="<{$vo['id']}>"><{$vo['title']}></option>
        </volist>
      </select>
      </div>
  </div>

  <p></p>
    
    
    <form id="ajaxForm" method="post" action="<{:U('Events/delsign')}>" name="form1" class="form-horizontal form-validata">
    <TABLE class="table table-striped table-bordered table-hover">
      <THEAD>
        <tr>
          <TH><input class="checkall" name="checkall" type="checkbox" id="checkall" onClick="CheckAll(this.form)"/> <{:L("_public_select")}></TH>
          <TH>id</TH>
          <TH>Events</TH>
          <TH>First Name</TH>
          <TH>Last Name</TH>
          <TH>Email</TH>
          <TH>Treated</TH>
          <TH>Study</TH>
          <TH>Date added</TH>
          <TH>Action</TH>
        </tr>
      </THEAD>
      <TBODY>             
            <volist name="list" id="vo">
            <tr>
              <td><input type="checkbox" name="selectedids[]" value="<{$vo.id}>" id="<{$vo.id}>"></td>
              <td><{$vo.id}></td>
              <td><{$vo.event}></td>
              <td><{$vo.firstName}></td>
              <td><{$vo.lastName}></td>
              <td><{$vo.email}></td>
              <td>
              <eq name="vo.status" value="1">
              <a href="<{:U('Events/close' , array('id'=>$vo['id']))}>" class="btn btn-sm btn-default">Yes</a>
              <else/> 
              <a href="<{:U('Events/open' , array('id'=>$vo['id']))}>" class="btn btn-sm btn-danger">No</a>
              </eq>
              </td>
              <td>
              <eq name="vo.study" value="1">
              <a href="<{:U('Events/closestudy' , array('id'=>$vo['id']))}>" class="btn btn-sm btn-default">Yes</a>
              <else/> 
              <a href="<{:U('Events/openstudy' , array('id'=>$vo['id']))}>" class="btn btn-sm btn-danger">No</a>
              </eq>
              </td>
              <td><{$vo.createTime|date='Y-m-d h:i:s',###}></td>              
              <td>
                <a href="javascript:void(0)" onclick="showModel('<{:U('Events/detail',array('id'=>$vo['id']))}>')" class="btn btn-default btn-sm"><i class="glyphicon glyphicon-eye-open"></i> view</a>
              </td>
            </tr>
            </volist>
      </TBODY>
    </TABLE>

    <div class="row">
        <div class="col-md-6">
            <button class="btn btn-info btn-sm" onClick="if(!confirm('Cannot be recovered after deletion!'))return false;"><i class="glyphicon glyphicon-trash"></i> Delete selected message</button>
        </div>
        
        <div class="col-md-6">
            <div class="page">
                <nav>
                    <ul class="pagination"><{$page}></ul>
                </nav>
            </div>
        </div>
    </div>
    </form>

<script>
function showModel(remote){
  $('#myModal').modal({
    remote : remote
  });

  $("#myModal").on("hidden.bs.modal", function() {
    $(this).removeData("bs.modal");
  })
}

$("#eventID").val("<{$eventID}>");

</script>     
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
      <div class="modal-content"></div>
  </div>
</div>

<input type="hidden" id="menu_action" value="events" />